/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.edu.itschapala.ssrp.util;

import javax.inject.Named;
import javax.enterprise.context.Dependent;

/**
 *
 * @author pello
 */
@Named(value = "passwordGenerator")
@Dependent
public class PasswordGenerator {

    /**
     * Creates a new instance of PasswordGenerator
     */
    public PasswordGenerator() {
    }
    
    
    public String pasword(){
        char[] elementos = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
        char[] conjunto = new char[8];
        for (int i = 0; i <=7; i++) {
            int el = (int) (Math.random() * 36);
            conjunto[i] = (char) elementos[el];
        }
        return new String(conjunto);
    }
}
